package com.study.queue;


import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TopicMqConfig {

    @Bean
    public TopicExchange topicExchange() {
//        Exchange build = ExchangeBuilder.topicExchange("study.topic").build();
        return new TopicExchange("study.topic2");
//        return build;
    }

    @Bean
    public Queue topicQueue() {
        return new Queue("study.topic3");
    }

    @Bean
    public Binding topicBinding(TopicExchange topicExchange, Queue topicQueue) {
        return BindingBuilder.bind(topicQueue).to(topicExchange).with("study.#");
    }

}
